home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / AMIGA / AMICUS / AMICUS19.ADF / C / COMAL.H < prev    next >
Text File  |  1989-01-27  |  3KB  |  133 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                                  Figure 1
  8.  
  9.                               COMAL.H LISTING
  10.  
  11.  
  12.  
  13.  
  14.  
  15. /*  This include file defines some constructs similar to COMAL  */
  16. /*  It also defines easily understood mathematical operators    */
  17.  
  18. /*  Logical operators  */
  19.  
  20. #define  AND  &&       /*  logical AND  */
  21. #define   OR  ||       /*  logical  OR  */
  22. #define  NOT   !       /*  logical NOT  */
  23. #define   EQ  ==       /*  equal value comparison  */
  24. #define   NE  !=       /*  not equal value comparison  */
  25. #define   LT   <       /*  less than value comparison  */
  26. #define   LE  <=       /*  less than or equal to value comparison  */
  27. #define   GT   >       /*  greater than value comparison  */
  28. #define   GE  >=       /*  greater than or equal to comparison  */
  29.  
  30. /*  Bitwise operators  */
  31.  
  32. #define  BITAND   &    /*  bitwise AND  */
  33. #define  BITOR    |    /*  bitwise  OR  */
  34. #define  BITXOR   ^    /*  bitwise exclusive OR  */
  35. #define  BITNOT   ~    /*  bitwise NOT  */
  36. #define  LSHF    <<    /*  left shift  */
  37. #define  RSHF    >>    /*  right shift  */
  38.  
  39. /*  Arithmetic operators  */
  40.  
  41. #define  INC     ++    /*  increment  */
  42. #define  DEC     --    /*  decrement  */
  43. #define  MOD      %    /*  modulo division  */
  44.  
  45. /*  IF_THEN_ELIF_ELSE construct  */
  46.  
  47. #define  IF(e)      { if (e)              /*  if statement  */
  48. #define  THEN       {                     /*  then statement  */
  49. #define  ELIF(e)    }  else if (e) {      /*  elseif statement  */
  50. #define  ELSE       }  else  {            /*  else statement  */
  51. #define  ENDIF      ; } }                 /*  end of if statement  */
  52.  
  53. /*  CASE construct  */
  54.  
  55. #define  CASE(e)    { switch (e) {        /*  case statement */
  56. #define  WHEN(e)    case e: {             /*  case block  */
  57. #define  ENDWHEN    } break;              /*  end of case block  */
  58. #define  OTHERWISE  default: {            /*  default case block  */
  59. #define  ENDCASE    } }                   /*  end of case  */
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73. /*  WHILE construct  */
  74.  
  75. #define  WHILE(e)   { while (e) {         /*  while statement  */
  76. #define  ENDWHILE   ; } }                 /*  end of while statement  */
  77.  
  78. /*  REPEAT construct  */
  79.  
  80. #define  REPEAT     { do {                /*  repeat statement  */
  81. #define  UNTIL(e)   ; } while (!(e)); }   /*  end of repeat statement  */
  82.  
  83. /*  FOR construct  */
  84.  
  85. #define  FOR(e)     { for (e) {           /*  for statement  */
  86. #define  ENDFOR     ; } }                 /*  end of for statement  */
  87.  
  88. /*  BEGIN_END construct  */
  89.  
  90. #define  BEGIN      {                     /*  beginning of block  */
  91. #define  END        }                     /*  end of block  */
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.